home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1 / Ian and Stuart's One (Australia).iso / Mac FAQs / FOXPro faq < prev    next >
Text File  |  1994-11-17  |  61KB  |  1,605 lines

  1. Archive-name: databases/foxpro/general
  2. Posting-frequency: monthly
  3.  
  4. [This is FAQ version 1.0.1.2 - Last Updated 10/27/94.  New sections or
  5. altered text are marked with ">" in the left hand column.  Please send
  6. all questions, comments, and whatnot to kcochran@nyx.cs.du.edu]
  7.  
  8. Welcome to comp.databases.xbase.fox.  This message is posted monthly,
  9. and can be found here, in news.answers, or you can receive a copy of
  10. this or any of the other comp.database.xbase.fox FAQ's by e-mailing me at
  11. kcochran@nyx.cs.du.edu.
  12.  
  13. This FAQ is available for anonymous FTP from rtfm.mit.edu.  For more
  14. information about the FAQ archive at rtfm.mit.edu, consult the newsgroup
  15. news.announce.newusers.
  16.  
  17. This FAQ is also available for anonymous FTP from rahul.net   These
  18. files are compressed, and located in the /pub/coneill directory.
  19. ***WARNING*** The FAQ's at rahul.net may or may not be the most current
  20. versions, depending on exactly which day I send them in, and which
  21. day you pick them up.
  22.  
  23. >Note that the ftp site on rahul.net has gone away.  This information
  24. >is mirrored at lenti.med.umn.edu:/pub/foxpro, which will continue for
  25. >the indefinite future.
  26.  
  27. This message is split into the following sections:
  28.  
  29. 0.0 - What is an FAQ?
  30. 0.1 - What is comp.databases.xbase.fox?
  31. 0.2 - What is FoxPro?
  32. 0.2.1 - What are FoxBase, FoxBase+, and the rest?
  33. 0.3 - How do I get information?
  34. 0.3.1 - What other FAQ's are available?
  35.  
  36. 1.0 - I just bought FoxPro; now what?
  37. 1.1 - The FoxPro books.
  38. 1.2 - Third-Party books.
  39. 1.3 - Database and FoxPro magazines.
  40. 1.4 - MicroSoft technical support.
  41. 1.5 - FTP locations.
  42. 1.6 - Other locations for information.
  43.  
  44. 2.0 - What are the parts of FoxPro?
  45. 2.1 - The Developers kit.
  46. 2.2 - The Distribution kit.
  47. 2.3 - The Library Construction kit.
  48. 2.4 - The Connectivity kit.
  49. 2.5 - FoxPro 2.6 "Standard Edition"/"Professional Edition"
  50.  
  51. 3.0 - I'm having a problem...
  52. 3.1 - Problems of "general" nature.
  53. 3.2 - Problems of "specific" nature.
  54. 3.3 - Problems with third-party add-ins.
  55. [Note:  Users have requested that we compile a "standard problem - solution"
  56.         list for inclusion in this section.  I'll be keeping that as a
  57.         seperate FAQ.]
  58.  
  59. [Note:  Sections are split with "******".]
  60.  
  61. Before we begin, I'd like to thank the following people not already
  62. mentioned in the FAQ for their assistance in putting this together:
  63.    1092143@MAINE.maine.edu (Donna Foster)
  64.    a.baxter@ic.ac.uk (Alex D. Baxter)
  65.    blank@silver.ucs.indiana.edu (Doug Blank)
  66.    davec@wsti.demon.co.uk (David Churcher)
  67.    DimaA@aomicrosoft.msk.su (Dmitry Artemov)
  68.    Garrett@heidi.demon.co.uk (Garrett Trant)
  69.    kruckenb@sal.cs.utah.edu (Pete Kruckenberg)
  70.    OB71216@IBMH1.ORL.MMC.COM (Steve)
  71.    pgoudswa@etc.cln.bc.ca (Peter Goudswaard)
  72.    peace@world.std.com (Jeremy Stark)
  73.    russel@atl.sofkin.ca (Paul Russell)
  74.    tdh@dweebus.telemax.com (Thomas D. Halter)
  75.    tonemb@mtfs.unit.no (Tone Merethe Berg)
  76.  
  77. ******
  78. 0.0 - What is an FAQ?
  79.       FAQ is short for "Frequently-asked-questions".  Over the course of
  80.       the net, especially in the technical areas, a lot of questions get
  81.       asked over and over and over ("How do I get my foo to bar in green
  82.       instead of red?").
  83.  
  84.       These questions get collected into a single message that is then
  85.       posted to the newsgroup at regular intervals (usually about once
  86.       a month).
  87.  
  88.       In the case of c.d.x.f, there are about a half-dozen FAQ's floating
  89.       around in various stages.  As I get approval to archive these at
  90. >      rtfm.mit.edu, I'll be including them in my postings.
  91.  
  92.       FAQ's also tend to have a lot of background information about the
  93.       newsgroup in question, information about the newsgroup, historical
  94.       persons important to the newsgroup, and I've even seen some that
  95.       have court cases in them.
  96.  
  97.       Basically, FAQ's are a lot of things for a lot of different people.
  98.       If you have an idea for an FAQ, write it up and mail it to me at
  99.       kcochran@nyx.cs.du.edu.  I'll be more than happy to maintain the
  100.       FAQ for you or to accept updates as needed.  You, of course, would
  101.       receive full credit for authorship.
  102.  
  103. ******
  104. 0.1 - What is comp.databases.xbase.fox?
  105.       comp.databases.xbase.fox (or c.d.x.f for short) is a newsgroup for
  106.       discussion about the Fox database management packages.  Technical
  107.       questions about Rushmore, the power tools, FoxBase, and other issues
  108.       are all relevant to c.d.x.f.
  109.  
  110.       General questions that relate specifically to FoxPro or the related
  111.       products (NetLib, dGE, etc) or technical questions about these items
  112.       are certainly relevant to the newsgroup.
  113.  
  114.       General questions about databases in general (I'm looking for a good
  115.       database package; How do I normalize my tables) should probably be
  116.       addressed in either comp.databases.xbase.misc or comp.databases.misc.
  117.       If you have a question of a general nature, you should also look
  118.       around the newsgroups list to see if there isn't a more relevant
  119.       group.
  120.  
  121.       c.d.x.f is not an advocacy group; please do not start discussions
  122.       about whether your Mac is better than the next guys IBM box.  Also,
  123.       you should avoid general slamming of products.  A conversation about
  124.       the differences between the FoxPro and Paradox screen builders would
  125.       be extremly informative; a post stating that "Paradox Sucks" is in
  126.       poor taste.
  127.  
  128. ******
  129. 0.2.1 - What are Foxbase, Foxbase+, and those other things?
  130.       The Fox database management packages are available for many
  131.       different operating systems and environments.  The various
  132.       packages are:
  133.  
  134.       Microsoft:
  135.          FoxPro 2.5 (DOS)
  136.          FoxPro 2.5 (Windows)
  137.          FoxPro 2.5 (Macintosh)
  138.          FoxPro 2.6 "Standard Edition" (DOS)
  139.          FoxPro 2.6 "Professional Edition" (DOS)
  140.          FoxPro 2.6 "Standard Edition" (Windows)
  141.          FoxPro 2.6 "Professional Edition" (Windows)
  142.          FoxPro 2.6 "Standard Edition" (Macintosh)
  143.          FoxPro 2.6 "Professional Edition" (Macintosh)
  144.  
  145.          FoxPro 2.5 (Unix, to be released in 1994)
  146.          [Anybody know if this is going to be 2.5 or 2.6?  Is there going
  147.          go be the Standard/Professional split?]
  148.  
  149.       Fox Software*:
  150.          FoxBASE+ (DOS)
  151.          FoxBASE+ (Macintosh)
  152.          FoxPro 1.1 (DOS)
  153.          FoxPro 2.0 (DOS)
  154.  
  155.       SCO (Santa Cruz Operation):
  156.          SCO FoxBASE+ (Unix)
  157.  
  158.       *Fox Software has been bought by Microsoft.  Their products are no
  159.        longer available, but are included here since many of their products
  160.        are still in use.
  161.  
  162. ******
  163. 0.3 - How do I get information?
  164.       This depends on what sort of information you need.  One of the best
  165.       places to get information is from the manuals.  If they don't give
  166.       you what you want, there are a wide variety of magazines, books,
  167.       FTP sites, and comp.* groups that may be able to provide you with
  168.       the information you need.
  169.  
  170. ******
  171. 0.3.1 - What other FAQ's are there?
  172.       Welcome To The Machine
  173.          (FAQ #0, archived at rtfm.edu under databases/foxpro/hello)
  174.          This FAQ contains a quick introduction to usenet etiquette,
  175.          pointers on how to compose posts, and pointers to some additional
  176.          newsgroups where you may be able to find information.  Originally
  177.          written by Pete Kruckenberg, and maintened by Keith Cochran.
  178.  
  179.       You Say You Want A Revolution:
  180.          (FAQ #1, archived at rtfm.edu under databases/foxpro/general)
  181.          This FAQ contains information of a general nature about c.d.x.f
  182.          It also contains address information for Microsoft, third-party
  183.          books about the Fox database management products, how to get
  184.          information from Microsoft, compuserve, and information about
  185.          FTP.
  186.  
  187.       See Fox.  See Fox Run.  Run, Fox, Run:
  188.          (FAQ #2, archived at rtfm.edu under databases/foxpro/rushmore)
  189.          This FAQ contains information of both a general and a specific
  190.          nature about the Rushmore technology.
  191.  
  192.       Things Your Mamma Never Told You About:
  193.          (FAQ #3, archived at rtfm.edu under databases/foxpro/misc)
  194.          This FAQ contains information about functions and commands in
  195.          FoxPro that "should" do something, but "don't", and those
  196.          commands that "shouldn't" do something, but "do".
  197.  
  198.       Variations On A Theme:
  199.          (FAQ #4, currently in "development" stage)
  200.          I'm still collecting information on other database packages
  201.          vs FoxPro for this FAQ.  If you have anything, contact me
  202.          at kcochran@nyx.cs.du.edu.  Don't bother asking for this FAQ.
  203.  
  204.       WHERE resource = onthenet
  205.          (FAQ #5, archived at rtfm.edu under databases/foxpro/resource)
  206.          This FAQ contains an exhaustive listing of FoxPro resources
  207.          available through the net.  FTP sites, mailing lists, and
  208.          newsgroups are all covered.  I'd like to extend my deepest
  209.          gratitude to Pete Kruckenberg (kruckenb@sal.cs.utah.edu)
  210.          for developing this listing.
  211.  
  212.       SET LIBRARY TO
  213.          (FAQ #6, currently in "development" stage)
  214.          This FAQ contains information on third-party add-ons for
  215.          FoxPro such as the FoxFire! report writer, or the GPLib
  216.          shareware Netware library.  If you'd like to include your
  217.          favorite add-in, mail a short description along with the
  218.          address/phone of the company to kcochran@nyx.cs.du.edu.
  219.  
  220. ******
  221. 1.0 - I just bought FoxPro; now what?
  222.       The *FIRST THING TO DO* is to fill our your registration card,
  223.       and mail it off to Microsoft.  This will give you the ability
  224.       to call Microsoft Technical Support with your problems.
  225.  
  226.       Calling Microsoft support is a mixed blessing.  It may get your
  227.       question answered, but you may have no hair left by the time it
  228.       works.  Then again, MicroSoft support is _the place_ to make sure
  229.       that you are not working against a program bug.
  230.  
  231. ******
  232. 1.1 - The FoxPro books.
  233.       One of the best places to find information is within the FoxPro books
  234.       that you got when you brought your package.  The Language Reference
  235.       Manual is the first place you should look when a command doesn't work
  236.       the way you expected it to.
  237.  
  238.       The Developer's Guide also has a lot of information on things that they
  239.       don't really mention in the language reference.  If you are having
  240.       problems getting your procedures to work correctly in your screens,
  241.       try taking a look there.
  242.  
  243. ******
  244. 1.2 - Third-Party books.
  245.       There are many, many books on how to develop and program in FoxPro.
  246.  
  247.       Some of the ones you may find useful are:
  248.       [Note:  Your milage may vary.]
  249.  
  250.       peace@world.std.com (Jeremy Stark) recommends:
  251.       "FoxPro 2.5 Developing Full-Scale Applications For Windows"
  252.       Written by Nelson King, and published by MIS:Press.
  253.  
  254.       "It's actually a beginners book and includes sections on
  255.       table normalization, project planning, and other topics related
  256.       to the consulting end of database design."
  257.  
  258.       It comes with a disk, costs $34.95, and also has a cute fox on
  259.       the cover.
  260.  
  261.       pgoudswa@etc.cln.bc.ca (Peter Goudswaard) recommends:
  262.       "FoxPro 2.5 - Programmer's Reference" by John Hawkins,
  263.       Editor-In-Chief of Data-Based Advisor Magazine, published
  264.       by Que, ISBN 1-56529-210-3.
  265.  
  266.       "Programming FoxPro 2.5" by Miriam Liskin, by Ziff-Davis Press,
  267.       ISBN 1-56276-164-1.
  268.  
  269.       tonemb@mtfs.unit.no (Tone Merethe Berg) Recommends:
  270.       Using FoxPro 2.5 for Windows, by Lisa Slater and Steven Arnott.
  271.       ISBN 1-56529-002-X.
  272.       "This is an excellent book for people like me, starting close to
  273.        zero, as well as for some like me, getting closer to 'experienced'.
  274.        As for you guru's, I guess it isn't too bad, either."
  275.  
  276.       FoxPro 2.5 Advanced Developers Handbook.  Brady Publishing, 1993.
  277.       ISBN 0-13-325341-4.  According to the author, it includes
  278.       "undocumented secrets, strategies, and tips from the experts, and
  279.        is especially written for those developing applications for a
  280.        network.  Data security and corruption protection, as well as
  281.        error-handling, user-interfaces, UDF-creation and other programming
  282.        techniques are main chapters."
  283.  
  284. ******
  285. 1.3 - Database and FoxPro magazines.
  286.       In addition to the books available, there are several magazines that
  287.       deal with xbase products, and some that deal exclusivly with FoxPro.
  288.  
  289.       FoxPro Advisor:
  290.       Advisor Communications International, Inc.
  291.       (The same people that do Data Based Advisor, Clipper Advisor,
  292.       dBase Advisor and Access Advisor).
  293.  
  294.       Published monthly.  $4.95/issue, or yearly subscription for $65.00
  295.       FoxPro Advisor Subscription Dept
  296.       PO Box 469032
  297.       Escondido CA  92046
  298.       (800) 336-6060
  299.  
  300.       FoxTalk Magazine:
  301.       FoxTalk
  302.       Pinnacle Publishing, Inc.
  303.       PO Box 888
  304.       Kent, WA 98035-0888
  305.       COMPUSERVE Address: 72600,140
  306.       Editorial Hotline: (800) 788-1900
  307.       BBS (2400) (206) 251-6217
  308.       BBS (9600) (206) 251-6218
  309.  
  310.       As of March, 1993 the numbers for Pinnacle Publishing are:
  311.       Pinnacle Publishing
  312.       18000 72nd Avenue South Suite 217
  313.       Kent, WA  98032
  314.  
  315.       Shipping and Receiving:
  316.       18030 72nd Avenue South
  317.       Kent, WA  98032
  318.  
  319.       Mailing Address:
  320.       PO Box 888
  321.       Kent, WA  98035-0888
  322.  
  323.       Phone Numbers:
  324.       General Line:  (206) 251-1900
  325.          (Weekdays 8am - 5pm PACIFIC time)
  326.       Sales:  (800) 788-1900
  327.       Fax:  (206) 251-5057
  328.       Tech Support:  (206) 251-3513
  329.          (Weekdays 8am - 5pm PACIFIC time)
  330.       BBS:  (206) 251-6218 (9600 Baud)
  331.             (206) 251-6217 (2400 Baud)
  332.  
  333.       They can also be reached on Compuserve by GO PINNACLE.
  334.  
  335.       The Pinter FoxPro Letter.
  336.       24 pages, published monthly by Les Pinter, author of at least
  337.       5 books on FoxPro.  You can reach him on compuserve at 76434,104.
  338.       If anybody gets any info (like pricing, mailing address, etc),
  339.       could they drop me a line with it so I can include it here?
  340.  
  341. ******
  342. 1.4 - Microsoft technical support.
  343.       Microsoft technical support is available from 6am to 6pm pacific
  344.       time monday through friday, except for holidays.  In the US, call:
  345.  
  346.       (206) 635-7191 (FoxPro/DOS and FoxPro/Windows)
  347.       (206) 635-7192 (FoxPro/Macintosh)
  348.  
  349.       In Canada, support engineers are available at (905) 568-3503.
  350.  
  351.       Microsoft FastTips is available 24 hours a day, 7 days a week at
  352.       (800) 936-4300 with a touch-tone phone.   You can receive automated
  353.       answers to common questions and problems, or access a library of
  354.       technical notes, all delivered by recording or fax.
  355.  
  356.       Microsoft can also be reached via compuserve.  Their "wish line"
  357.       on the net is foxwish@microsoft.com
  358.  
  359. ******
  360. 1.5 - FTP locations.
  361.  
  362.       You can FTP anonymously to microsoft.com, and look in the directory
  363.       /developer/devtools/fox for support and patch files, upgrade
  364.       information, and other stuff.  The IP address is 198.105.232.1
  365.  
  366. ******
  367. 1.6 - Other sources of information.
  368.       COMPUSERVE:  At any ! prompt, type "go microsoft" to access the
  369.       Microsoft forums, "go mskb" to access the Microsoft Knowledge Base,
  370.       or "go foxforum" to access FoxPro specific information.
  371.  
  372.       There is an existing FoxPro mailing list:
  373.  
  374.       To subscribe to the FoxPro mailing list, send the following in a
  375.       mail message to fileserv@polarbear.rankin-inlet.nt.ca:
  376.  
  377.       JOIN FOXPRO-I kcochran@nyx.cs.du.edu
  378.       QUIT
  379.  
  380.      [Note that you would use your e-mail address to subscribe, not
  381.      mine.]
  382.  
  383.       [Note: That's "I" as in "GHIJ", not "1" as in "1234".  You can
  384.       also get a digest version of the list by doing a JOIN FOXPRO-D
  385.       instead of JOIN FOXPRO-I.
  386.  
  387.       To get help for this mailing list, send email to
  388.       foxpro-help@polarbear.rankin-inlet.nt.ca.  The subject and message
  389.       are unimportant.  You can also contact the list administrator at
  390.       coneill@polarbear.rankin-inlet.nt.ca.  Responses may take 48-72
  391.       hours because polarbear is on a daily dial-up connection.
  392.  
  393.       And there may be a second list forming:
  394.  
  395.          foxpro-l@ukanvm.cc.ukans.edu
  396.  
  397.       For information on subscribing, send email to LISTSERV@UKANVM.BITNET
  398.       with "HELP" as the first word of the message to receive a help file.
  399.  
  400.       If anybody has any additional information on mailing lists or
  401.       FTP sites, please contact me.
  402.  
  403.       The BCNN FoxPro electronic newsletter is published monthly in
  404. >      comp.databases.xbase.fox.  Subscriptions are free, and the
  405.       information on how to subscribe is included at the bottom of
  406.       each newsletter.
  407.  
  408. ******
  409. 2.0 - What are the parts of FoxPro?
  410.       There are many different parts to FoxPro, even within FoxPro itself.
  411.       Just because you have a compiled application doesn't mean that it will
  412.       work correctly.  For example, if your application uses printer drivers,
  413.       then you will have to include genpd.app as part of your project.
  414.  
  415.       Some of the other external parts of FoxPro are:
  416.       genscrn.prg - Generates your .spr file from the screen database.
  417.       genmenu.prg - Generates your .mpr file from the menu database.
  418.       beautify.app - Used to beautify applications brought over from other
  419.          platforms.  It is not yet available for the DOS platform.
  420.       foxdoc.app - Documentation generator.  This is known as foxdoc.exe
  421.          in the DOS platform.
  422.       gengraph.app - Graph generator.
  423.       spellchk.app - Spell checker.
  424.       genxtab.prg - Generation cross-tabulations from a database.
  425.       transport.prg - Used to migrate applications across platforms.
  426.  
  427. ******
  428. 2.1 - The Developers kit.
  429.       This is the "best known" of the FoxPro parts.  This the set that
  430.       gives you the "command window", and allows you to create applications,
  431.       databases, compile them, etc.
  432.  
  433. ******
  434. 2.2 - The Distribution kit.
  435.       In order to run a FoxPro application, you have to have FoxPro, right?
  436.       Wrong.  Instead of forcing everybody to spend the $$$ to buy the
  437.       development kit just so they can run their accounting software, you
  438.       can purchase the Distribution Kit.
  439.  
  440.       The distribution kit allows you to distribute and run an application
  441.       without providing the full FoxPro interface (command window, filer,
  442.       etc).  This distribution is done ROYALTY-FREE.  Once you have brought
  443.       the distribution kit, and compiled your executable, you do not have
  444.       to pay MicroSoft anything in order to sell your application to
  445.       another person.
  446.  
  447.       Note that the Distribution Kit does not actually compile your
  448.       FoxPro code into machine language.  Instead, it produces an .EXE
  449.       file containing a copy of the FoxPro interpreter and your program
  450.       compiled into pseudo-code.
  451.  
  452. ******
  453. 2.3 - The Library Construction kit.
  454.       Found something that FoxPro won't do?  Want it to be able to do it?
  455.       Purchase the Library Construction kit, and teach FoxPro new tricks!
  456.  
  457.       The LCK allows you to write your own functions in C, and then link
  458.       them into FoxPro as a .plb file.  The functions have _NONE_ of the
  459.       limitations of .bin files (used by LOAD and CALL), and can take
  460.       full advantage of FoxPro's memory management, windowed i/o, and
  461.       other features.  You can even call FoxPro commands from within
  462.       your external function.
  463.  
  464.       The LCK covers DOS and Windows platforms (Windows files have the
  465.       extension .fll instead of .plb).  A C compiler is not included.
  466.       The supported C compilers are Microsoft C v8 and Watcom C v8.5.  It
  467.       is possible to use Borland C++ v3.1 to produce Windows .FLL files,
  468.       but this is not officially supported.
  469.  
  470. ******
  471. 2.4 - The Connectivity kit.
  472.       What's that?  Human Resources has 10 years of information stored on
  473.       the server in SYBASE format, and they want you to analyze it?  With
  474.       the connectivity kit, this is no problem.  Just attach to the server,
  475.       log yourself into the database, and start analyzing.
  476.  
  477.       The connectivity kit comes in two "flavors".  DOS and Windows.
  478.       The DOS version is a .plb file that allows you to attach to Sybase
  479.       and Oracle servers.  No other servers are supported.  The Windows
  480.       .fll driver allows you to connect via ODBC to a wide range of
  481.       database servers.
  482.  
  483.       In order to use the Windows version, you must also buy the ODBC
  484.       Desktop Drivers from Microsoft.
  485.  
  486.       Data access is performed by using a CK function to register yourself
  487.       to your data source, and then using other CK functions to pass and
  488.       retrieve SQL statements to the server.
  489.  
  490. *****
  491. 2.5 - FoxPro 2.6 "Standard Edition"/"Professional Edition"
  492.       Versions of FoxPro prior to 2.6 came in many different "sections"
  493.       (described above).  FoxPro/MAC 2.5, and FoxPro/DOS 2.6, and
  494.       FoxPro/Windows 2.6 only come in two "flavors".  These are:
  495.  
  496.       Standard Edition:  This contains what used to be called the
  497.       Development Kit.
  498.  
  499.       Professional Edition:  This contains:
  500.       Development Kit
  501.       Distribution Kit
  502.       Library Construction Kit
  503.       Connectivity Kit
  504.       Windows for WorkGroups Extensions (FP/WIN only)
  505.  
  506.       Also, the "Standard Edition" and "Professional Edition" only
  507.       come as one license/package.  No bundling.
  508.  
  509. ******
  510. 3.0 - I'm having a problem...
  511.       Join the club.  Fortunatly, the kind folks of c.d.x.f will be more
  512.       than happy to help solve your FoxPro problems.
  513.  
  514.       SOME RULES TO MAKE YOUR LIFE EASIER:
  515.  
  516.       (1)Please be sure to mention what VERSION and ENVIRONMENT of Fox*
  517.          you are using.  Some of the things you can do in FoxPro 2.5
  518.          will not work at all under FoxBase+, or on the Unix flavors.
  519.  
  520.       (2)Please be sure to mention anything odd that you are doing.
  521.          Specifically, .plb files and SQL tends to cause "strange"
  522.          things to happen.  If you have the files in a project, please
  523.          be sure to mention that.  If you are using the distribution kit,
  524.          and the problem only appears when you are running it under the
  525.          distribution kit, please mention that.
  526.  
  527.          IF YOU ARE MIGRATING AN APPLICATION FROM ANOTHER XBASE PRODUCT,
  528.          MENTION IT!
  529.  
  530.       (3)Do _NOT_ end your question with "Please e-mail me the answer,
  531.          as I don't read this newsgroup".  I mention this for a couple
  532.          of reasons:
  533.          
  534.          (1)Not everybody has the ability to cc: people on postings.
  535.             The problem you are having may be the same problem that
  536.             many other people are having.
  537.  
  538.          (2)The problem that I have next week is something that you
  539.             might be able to solve for me in an instant.  I don't think
  540.             it's really fair for you to get help from us if we have no
  541.             chance of getting help from you.
  542.  
  543. ******
  544. 3.1 - Problems of "general" nature.
  545.       These problems are generally of a "how do I..." nature, and are probably
  546.       most quickly solved by reading the manual.  I cannot emphasis enough
  547.       that the manuals and on-line help should be your first defense against
  548.       problems.
  549.   
  550.       For example, we recently had a poster ask "how do I generate a random
  551.       number between x and y?"  This problem can be solved by looking at
  552.       the RAND() function in the Language Reference Manual.
  553.  
  554. ******
  555. 3.2 - Problems of "specific" nature.
  556.       If you've got specific problems, please be sure provide enough detail
  557.       with your post to allow us to help you.  Code samples are always
  558.       nice, as is a short (or long) description of what it is you are
  559.       trying to do.  If you have databases linked with SET RELATION, please
  560.       be sure to mention this.
  561.  
  562. ******
  563. 3.3 - Problems with third-party add-ins.
  564.       Probably the best place to solve problems with .plb files is with
  565.       the company that produces it.  But you may be able to get better
  566.       response by fishing in c.d.x.f
  567.  
  568.  
  569. [This is version 1.0.0.2, last updated 07/03/94. New or altered text
  570. is marked with ">" in the left hand column.  Please send all comments,
  571. suggestions, and whatnot to kcochran@nyx.cs.du.edu]
  572.  
  573. One of the most my mysterious things about FoxPro is the Rushmore
  574. Technology.  This FAQ deals with Rushmore, and how to use it to get
  575. every last ounce of power out of your databases.
  576.  
  577. This FAQ is organized in the following manner:
  578.  
  579. 0.0 What is Rushmore?
  580. 0.1 What isn't Rushmore?
  581. 0.2 Why is it called Rushmore?
  582.  
  583. 1.0 How do I turn on Rushmore?
  584. 1.1 Where can I utilize Rushmore?
  585. 1.2 Where can't I utilize Rushmore?
  586. 1.3 How do I turn off Rushmore?
  587.  
  588. 2.0 Simple indexes and Rushmore.
  589. 2.1 Compound indexes and Rushmore.
  590. 2.2 Complex indexes and Rushmore.
  591.  
  592. 3.0 Using functions in indexes.
  593. 3.1 Using user-defined functions in indexes.
  594. 3.2 Using functions from .plb files in indexes.
  595.  
  596. 4.0 What is an "optimizable expression"?
  597. 4.1 Fully optimizable expressions.
  598. 4.2 Partially optimizable expressions.
  599. 4.3 Non-optimizable expressions.
  600.  
  601. 5.0 Rushmore and the SEEK statement.
  602. 5.1 Rushmore and the LOCATE statement.
  603. 5.2 Rushmore and the SET ORDER TO statement.
  604. 5.3 Rushmore and the SET RELATION TO statement.
  605. 5.4 Rushmore and the SET DELETED statement.
  606.  
  607. [Note each of these sections is seperate with "******"]
  608.  
  609. ******
  610. 0.0 What is Rushmore?
  611.     The "simple" answer:  Rushmore is this little bit of magic that allows
  612.     you main-frame database access speeds on a lowly PC.
  613.  
  614.     The "more complex" answer:  Rushmore is a data-access method that utilizes
  615.     binary selection critera and better index-manipulation methods to allow
  616.     faster resolution of searches.
  617.  
  618.     [If you want to know what the "more complex" answer is really saying,
  619.     take a graduate course in database programming.]
  620.  
  621.     The "correct" answer:  Rushmore is a mountain in South Dakota which has
  622.     been carved into the faces of several presidents. :]
  623.  
  624. ******
  625. 0.1 What isn't Rushmore?
  626.     Rushmore has nothing to do with satanism.
  627.     Rushmore has nothing to do with the power tools.
  628.     Rushmore has nothing to do with your report layouts.
  629.     Rushmore has nothing to do with your mouse or keyboard.
  630.  
  631. ******
  632. 0.2 Why is it called Rushmore?
  633.     Oddly enough, the design team came up with the "code-name" Rushmore
  634.     after spending a night watching the movie "North By Northwest."
  635.  
  636. ******
  637. 1.0 How do I turn on Rushmore?
  638.     You don't.  Any time you can include a FOR clause in a statement,
  639.     Rushmore will try to optimize the expression.
  640.  
  641.     Some exceptions apply.  For example, Rushmore will not activate if
  642.     you have a statement with a WHILE clause in it.
  643.  
  644.     Rushmore works best with .CDX indexes, but it will utilize any open
  645.     .IDX or compact .IDX indexes that it can get its greedy little hands
  646.     upon.
  647.  
  648. ******
  649. 1.1 Where can I utilize Rushmore?
  650.     You can utilize Rushmore in any FoxPro statement that allows a FOR
  651.     clause, or in an SQL statement.  If you are dealing with databases
  652.     of any size, you should utilize Rushmore as often as possible.
  653.  
  654.     Note:  The only way to utilize Rushmore when doing multi-database
  655.     access is through the SQL SELECT statement.
  656.  
  657. ******
  658. 1.2 Where can't I utilize Rushmore?
  659.     Basically, if you can't include a FOR clause, you can't use Rushmore.
  660.  
  661.     Rushmore also can't be used if you have a WHILE clause in your statement,
  662.     or if you are doing a LOCATE on the child table in a multi-table
  663.     relation.
  664.  
  665.     Note that SEEK and GOTO do not utilize Rushmore.
  666.  
  667. ******
  668. 1.3 How do I turn off Rushmore?
  669.     In some rare instances, you may want to turn off Rushmore so that it
  670.     doesn't try to optimize your expression.
  671.  
  672.     In order to do so there are two methods:
  673.  
  674.     SET OPTIMIZE ON|OFF - This turns Rushmore on/off until the next SET
  675.     OPTIMIZE statement is executed.  It is probably not a good idea to
  676.     use this statement.
  677.  
  678.     There is another way to disable Rushmore.  Any statement that can
  679.     utilize Rushmore has a NOOPTIMIZE clause.  This clause will disable
  680.     Rushmore for that statement.  Note that if you have a multi-line
  681.     statement, such as:
  682.  
  683.     SELECT db1
  684.     LOCATE FOR foo=bar NOOPTIMIZE
  685.     WHILE FOUND()
  686.        SELECT db2
  687.        LOCATE FOR date1 = m.mydate
  688.        WHILE FOUND()
  689.           [...]
  690.           CONTINUE
  691.        ENDWHILE
  692.        SELECT db1
  693.        CONTINUE
  694.     ENDWHILE
  695.  
  696.     Rushmore will be disabled for the db1 LOCATE, but will be active for
  697.     the db2 LOCATE.
  698.  
  699.     NB:  Be very wary of using GOTO, LOCATE, SEEK, SKIP or any other command
  700.     that may move the record pointer (like APPEND, or SQL - SELECT) in any
  701.     databases that are linked using SET RELATION TO.  You may not like the
  702.     results.
  703.  
  704. ******
  705. For the following discussions, we have the following database structure:
  706.    fname C(15)
  707.    minit C(1)
  708.    lname C(18)
  709.    dob D
  710.    ssn N(9,0)
  711.  
  712. ******
  713. 2.0 Simple indexes and Rushmore.
  714.     A simple index is of the form:
  715.  
  716.     INDEX ON ssn TAG ssn
  717.  
  718.     This is the type of index that Rushmore likes using the "best".  In
  719.     order to utilize Rushmore with this type of tag, all you have to do
  720.     is:
  721.  
  722.     LOCATE FOR ssn = 987654321
  723.  
  724.     Simple indexes are generally only built on numeric, date, or
  725.     formatted character fields.  For more information on why this is
  726.     so, see sections 2.2, 3.0, and 4.0.
  727.  
  728. ******
  729. 2.1 Compound indexes and Rushmore.
  730.     A coumpound index is of the format:
  731.  
  732.     INDEX ON lname+fname TAG name
  733.  
  734.     In order to utilize this type of tag with Rushmore, you have to:
  735.  
  736.     LOCATE FOR lname+fname = "Cochran Keith"
  737.  
  738.     What's that?  You want to know why you wouldn't use:
  739.  
  740.     LOCATE FOR name = "Cochran Keith"
  741.  
  742.     Well, there's a reason for that, and it's even a good one.  The TAG
  743.     parameter is for your usage. Rushmore understands expressions, not
  744.     tags.
  745.  
  746.     In order to get Rushmore to work, the expression on the left side of
  747.     the expression must match in essence the expression of the INDEX ON
  748.     statement.  So, the following are things that Rushmore can't utilize
  749.     with our current INDEX statement:
  750.  
  751.     LOCATE FOR UPPER(lname+fname) = "COCHRAN KEITH"
  752.     LOCATE FOR LTRIM(lname)+fname = "COCHRAN KEITH"
  753.     LOCATE FOR lname+" "+fname = "Cochran Keith"
  754.  
  755.     For a discussion of how to correctly utilize Rushmore with functions,
  756.     see sections 2.2 and 3.0.
  757.  
  758.     NB: Special care must be taken when creating compound or complex indexes
  759.     with numeric and date fields.  For more information, see the INDEX ON
  760.     section in the FAQ "Things your Mamma never told you".
  761.  
  762. ******
  763. 2.2 Complex indexes and Rushmore.
  764.     A complex index is any index that uses math, string, or other functions
  765.     as part of the index.  Some examples:
  766.  
  767.     INDEX ON DTOS(date) TAG cdate
  768.     INDEX ON lname+", "+fname TAG fullname
  769.     INDEX ON STR(ssn) TAG cssn
  770.     INDEX ON ssn+DAY(date) TAG mytag
  771.  
  772.     In order to get Rushmore to work with these indexes, the index expression
  773.     must match the expression you are locating on.
  774.  
  775. ******
  776. 3.0 Using functions in indexes.
  777.     As you've seen from the preceeding section, you can utilize any FoxPro
  778.     function in your index.  The question as far as Rushmore is concerned
  779.     is - should you?
  780.  
  781.     In most cases, the answer is yes.  The caveat here is that when you're
  782.     designing your database, you need to be aware of the trade-off between
  783.     getting better speed through Rushmore, and taking longer to update your
  784.     indexes when you change or add records.
  785.  
  786.     The other major pitfall with using functions in your indexes is how you
  787.     solve for the solutions later.  Most people, if they have an index on
  788.     UPPER(lname+fname), and two input fields, m.last and m.first, will
  789.     attempt to:
  790.  
  791.     LOCATE FOR UPPER(lname+fname) = UPPER(m.last+m.first)
  792.  
  793.     This will work, and Rushmore will optimize it, but you won't see any
  794.     real speed increase.  The reason for this is because the
  795.     UPPER(m.last+m.first) is evaluated for EVERY RECORD in the database.
  796.  
  797.     In order to properly utilize this index, you should:
  798.  
  799.     m.search = UPPER(m.last+m.first)
  800.     LOCATE FOR UPPER(lname+fname) = m.search
  801.  
  802. ******
  803. 3.1 Using user-defined functions in indexes.
  804.     Rushmore is able to utilize FoxPro functions in index expressions,
  805.     and it is also able to utilize user-defined functions (udf's) in
  806.     its optimization process.  There are several things you have to be
  807.     aware of, though:
  808.  
  809.     1) The speed that Rushmore can process is limited by how fast your
  810.        function executes.
  811.  
  812.     2) Be extremly careful about what your function does.  Your function
  813.        should make no guesses about the current operating environment, the
  814.        value of SET EXACT, SET ORDER, SET RELATION, etc.
  815.  
  816.     3) Your function ***MUST NOT*** modify any databases.  Doing so can
  817.        cause everything from "something strange is happening" to "FoxPro
  818.        must be buggy - it gets stuck in an endless loop."
  819.  
  820.     4) Be extremly careful about any variables you function may modify.
  821.        It's extremly easy to get the "wrong" result when your function
  822.        modifies one of your search variables.
  823.  
  824.     5) Your function ***MUST NOT*** move the record pointer in any database
  825.        hooked into the database you're using with SET RELATION.  It ***MUST
  826.        NOT*** move the record pointer in the current database.
  827.  
  828. ******       
  829. 3.2 Using functions from .plb files in indexes.
  830.     As long as the function in the .plb is "well behaved", there should be
  831.     no problems using it.  Remember the points in section 3.1, though.
  832.  
  833. ******
  834. 4.0 What is an "optimizable expression"?
  835.     An optimizable expression is any expression that Rushmore can attempt
  836.     to use.  How well Rushmore can work with the expression determines if
  837.     the expression is fully, partially, or non-optimizable.
  838.  
  839.     All of the examples used up to now were either fully optimizable, or
  840.     non optimizable.  Expressions that may be partially optimizable generally
  841.     take the format of:
  842.  
  843.     LOCATE FOR lname = "Cochran" AND ssn = 987654321
  844.  
  845. ******
  846. 4.1 Fully optimizable expressions.
  847.     In order for our last LOCATE statement to be fully optimizable, we
  848.     would have to:
  849.  
  850.     INDEX ON lname TAG lname
  851.     INDEX ON ssn TAG ssn
  852.  
  853.     This is the "best" solution, and will allow Rushmore to find the records
  854.     the fastest.
  855.  
  856. ******
  857. 4.2 Partially optimizable expressions.
  858.     If we had the index on ssn, but no index on lname, then our expression
  859.     would partially optimizable.  Rushmore would activate to locate the
  860.     records which matched our ssn, and then treat the rest of the expression
  861.     as a non-optimizable search.  Note that Rushmore is smart enough that
  862.     it will solve for the optimizable portions first, and then perform
  863.     the rest of the search on the subset of records it already has.
  864.  
  865. ******
  866. 4.3 Non-optimizable expressions.
  867.     A non-optimizable expression is one that Rushmore can't help.  You want
  868.     to avoid these expressions in all but the most extreme cases.  The
  869.     reason is that FoxPro will search every record in the database,
  870.     starting at RECNO() = 1.
  871.  
  872.  
  873. ******
  874. 5.0 Rushmore and the SEEK statement.
  875.     Basically, the SEEK statement, and the SEEK() function don't interact
  876.     with Rushmore at all.  This can be both a blessing and a curse.  For
  877.     simple indexes, you can get faster results out of SEEK than you
  878.     can out of Rushmore.  But SEEK will not allow you to search on
  879.     multiple fields...
  880.  
  881. 5.1 Rushmore and the LOCATE and SCAN statements.
  882.     Rushmore will almost always speed up your queries when using LOCATE FOR
  883.     or SCAN FOR statements.  To get the best use of Rushmore in these
  884.     statements, you should build simple indexes on the fields you will
  885.     most often search through.
  886.  
  887. 5.2 Rushmore and the SET ORDER TO statement.
  888.  
  889.     [Many thanks to Evan Simpson (evan@access.digex.net) for helping clear
  890.     up a misconception about the SET ORDER TO statement for me.]
  891.  
  892.     (1)The speed of the search will be slower.  This is true whether you
  893.        are using Rushmore or not.
  894.     (2)The first record Rushmore locates (i.e. LOCATE FOR foo = "bar")
  895.        will be the lowest numbered record in the database [RECNO()] that
  896.        matches the search criteria, regardless of the SET ORDER TO clause.
  897.  
  898.        For example, let's assume we have:
  899.        RECNO()   FOO BAR
  900.              1   AAA BBB
  901.              2   AAA CCC
  902.              3   AAA DDD
  903.              4   AAA CCC
  904.  
  905.        If you:
  906.        SET ORDER TO BAR
  907.        LOCATE FOR bar = "CCC"
  908.  
  909.        Rushmore will locate RECNO() 2, and then RECNO() 4.
  910.  
  911.        If you:
  912.        SET ORDER TO bar
  913.        LOCATE FOR foo = "AAA"
  914.  
  915.        Then Rushmore will locate records in the following order:
  916.        RECNO() 1
  917.        RECNO() 2
  918.        RECNO() 4
  919.        RECNO() 3
  920.  
  921.        Of course, you shouldn't program with this in mind, because Microsoft
  922.        may change it in future releases.
  923.  
  924. 5.3 Rushmore and the SET RELATION TO statement.
  925.     Beware of attempting to use Rushmore along with SET RELATION.  Due
  926.     to the constraints of the SET RELATION statement, Rushmore will
  927.     either not work at all, or will only work in very limited cases.
  928.  
  929. 5.4 Rushmore and the SET DELETED statement.
  930.     Rushmore can optimize a query for deleted() IF you index on deleted().
  931.     If your database contains a large number of deleted records, you
  932.     can help Rushmore out by either indexing on deleted(), or by using
  933.     the SET DELETED OFF statement before you invoke Rushmore.
  934.  
  935.  
  936.  
  937.  
  938. WHAT'S IN THIS FAQ:
  939.  
  940. Abnormal Program Termination in Extended FoxPro
  941.    kruckenb@sal.cs.utah.edu (Joseph Kruckenberg)
  942.  
  943. Diagonal Lines In FoxPro/Windows
  944.    blank@silver.ucs.indiana.edu (Doug Blank)
  945.  
  946. Generating Complex Indexes On Numeric Fields
  947.  
  948. Getting Rid Of The Microsoft FoxPro Screen And Title
  949.  
  950. Outer Joins In FoxPro
  951.    davec@wsti.demon.co.uk (David Churcher)
  952.  
  953. Source Code Wanted - Only Singles Need Apply
  954.    martin@convext.csd.uwm.edu (Martin A. Miller)
  955.  
  956. Unsupported Trick To Get Blank (Not Zero) Fields
  957.    wsd@world.std.com (Rorschach)
  958.  
  959. Writable SQL Cursors!
  960.    lotridge@charlie.ccd.bnl.gov (Charlie Lotridge)
  961.  
  962. *****
  963. Abnormal Program Termination in Extended FoxPro
  964.    kruckenb@sal.cs.utah.edu (Joseph Kruckenberg)
  965.  
  966. So, you're running along in the Extended Version of FoxPro when all
  967. of a sudden you see:
  968.  
  969. abnormal program termination: page fault. cs:eip=000ch:0007791fh
  970.  
  971. (Note:  cs:eip may point to pretty much anywhere.  If you don't know
  972. 386 assembler, don't worry about what the numbers mean.)
  973.  
  974. Now what?  You can fire FoxPro back up and hope and pray that it doesn't
  975. happen again, or you can add the following line to your AUTOEXEC.BAT
  976. file:
  977.  
  978. SET FOXPROX=-saveregs
  979.  
  980. (Note:  No spaces between the equals and minus signs.)
  981.  
  982. This command tells FoxPro to preserve any registers in use and not to
  983. overwrite them while running (given the limited explanation I recieved).
  984.  
  985. *****
  986. Diagnoal Lines In FoxPro/Windows
  987.    blank@silver.ucs.indiana.edu (Doug Blank)
  988.  
  989. Is there any way to draw lines that are neither horizontal or vertical in
  990. FoxPro?  I am trying to make line graphs from data without using Microsoft
  991. Graph. Any ideas?
  992.  
  993. Yes, it is sad but true: you cannot draw a diagonal line. I did try
  994. dropping down to the windows API, and you can in fact draw any thing
  995. that you want in the fox window --- but Fox doesn't "know" about it.
  996. Therefore, if you close the window and reopen it your line is gone.
  997. Any time that you cover your line, it won't be redrawn.
  998.  
  999. So, I finally ended up with the solution below. It does a pretty good
  1000. job on arbitrary lines. You may have to adjust x and y dotsize. These
  1001. parameters exist because of translation problems from real-valued
  1002. points to screen coordinates (welcome to the world of GUI's!)
  1003.  
  1004. To use, call with:
  1005.  
  1006. =drawline(1,5,11,30,.T.) && to produce a color line from @ 1,5 to 11,30 or
  1007. =drawline(1,5,11,30)     && to produce a black line 
  1008.  
  1009. Using this method, you can draw circles, splines, etc. Put the
  1010. function below in your program, or comment out the first line and
  1011. place in a file named DRAWLINE.PRG. It's not real fast nor smooth,
  1012. but it works. You probably can't make the line any thinner due to
  1013. related problems with real-valued vs. screen coordinates, so pensize
  1014. and penlength probaly can't be changed. You can change the RGB()
  1015. funtion to make any colors you want, or even add a CASE statement to
  1016. do them all, add shadows, etc.
  1017.  
  1018. FUNCTION drawline
  1019. PARAMETER x1,y1,x2,y2,color
  1020. PRIVATE x,y,B,slope
  1021. #DEFINE xdotsize (.2)
  1022. #DEFINE ydotsize (.5)
  1023. #DEFINE pensize (3)
  1024. #DEFINE penlen (.7)
  1025. IF m.y1 = m.y2 && vertical line
  1026.    IF x1 < x2
  1027.       IF color
  1028.          @m.x1,m.y1 to m.x2,m.y1 pen pensize color ;
  1029.             RGB(0,255,0,255,255,255) style "T"
  1030.       ELSE
  1031.          @m.x1,m.y1 to m.x2,m.y1 pen pensize color ;
  1032.             RGB(255,0,255,255,255,255) style "T"
  1033.       ENDIF
  1034.    ELSE
  1035.       IF color
  1036.          @m.x2,m.y1 to m.x1,m.y1 pen pensize color ;
  1037.             RGB(0,255,0,255,255,255) style "T"
  1038.       ELSE
  1039.          @m.x2,m.y1 to m.x1,m.y1 pen pensize color ;
  1040.             RGB(255,0,255,255,255,255) style "T"
  1041.       ENDIF
  1042.    ENDIF
  1043. ELSE
  1044.    m.slope = (m.x1 - m.x2)/(m.y1 - m.y2)
  1045.    m.B = m.x1 - (m.slope * m.y1)
  1046.    IF ABS((m.x1 - m.x2) / xdotsize) > ABS((m.y1 - m.y2) / ;
  1047.       ydotsize)
  1048.       FOR m.x = m.x1 TO m.x2 STEP xdotsize * ;
  1049.          IIF( m.x1 > m.x2, -1, 1)
  1050.             m.y = (m.x - m.B) / m.slope
  1051.             IF color
  1052.                @m.x,m.y to m.x,m.y+penlen pen ;
  1053.                   pensize color RGB(0,255,0,255,255,255) ;
  1054.                   style "T"
  1055.             ELSE
  1056.                @m.x,m.y to m.x,m.y+penlen pen ;
  1057.                   pensize color RGB(255,0,255,255,255,255) ;
  1058.                   style "T"
  1059.             ENDIF
  1060.       ENDFOR
  1061.    ELSE
  1062.       FOR m.y = m.y1 TO m.y2 STEP ydotsize * IIF( m.y1 > ;
  1063.          m.y2, -1, 1)
  1064.          m.x = (m.slope * m.y) + m.B
  1065.          IF color
  1066.             @m.x,m.y to m.x,m.y+penlen pen ;
  1067.                pensize color RGB(0,255,0,255,255,255);
  1068.                style "T"
  1069.          ELSE
  1070.             @m.x,m.y to m.x,m.y+penlen pen ;
  1071.                pensize color RGB(255,0,255,255,255,255) ;
  1072.                style "T"
  1073.          ENDIF
  1074.       ENDFOR
  1075.    ENDIF
  1076. ENDIF
  1077. RETURN
  1078.  
  1079. *****
  1080. Generating Complex Indexes On Numeric Fields
  1081.  
  1082. There's an interesting "feature" that the FoxPro manuals don't tell
  1083. you about in the information on indexes.  Let's say you have a database:
  1084. ACCOUNT N(6,0)
  1085. SSN N(9,0)
  1086.  
  1087. On first glance, if you wanted to sort the database by social security
  1088. number, and then account, you can just:
  1089.  
  1090. INDEX ON SSN+ACCOUNT TAG myorder
  1091. SET ORDER TO myorder
  1092.  
  1093. This, of course, doesn't work.  What happens is that FoxPro just adds
  1094. the values together, causing:
  1095.  
  1096. SSN = 076541111 ACCOUNT = 999999 (Key value = 77541110)
  1097.  
  1098. To appear AFTER
  1099.  
  1100. SSN = 076541122 ACCOUNT = 000333 (Key value = 76541455)
  1101.  
  1102. Note:  Microsoft assures me that this problem doesn't occur if you are
  1103. working with N(x,y > 1) fields, date fields, or logical fields.
  1104.  
  1105. What can you do to sort properly?  There are several schools of thought:
  1106.  
  1107. (1)You can add a digit after the decimal point.  Microsoft assures me
  1108.    that this will solve the problem.
  1109.  
  1110. (2)If you're working with fixed length fields, you can shift one set
  1111.    of digits over so that your math is correct.  In the above example,
  1112.    you would want to:
  1113.    INDEX ON ssn*1000000+account TAG myorder
  1114.  
  1115. (3)Convert the numerics into strings, and concatenate them:
  1116.    INDEX ON STR(ssn)+STR(account) TAG myorder
  1117.  
  1118.    or:
  1119.  
  1120.    INDEX ON TRANSFORM(ssn,"#########")+TRANSFORM(account,"######") TAG myorder
  1121.  
  1122. *****
  1123. Getting Rid Of The Microsoft FoxPro Screen And Title
  1124.  
  1125. The first thing to do if you're tired of seeing "Microsoft FoxPro"
  1126. every time you start your application is to use the -T command line
  1127. option to prevent it from showing up.  This looks like this:
  1128.  
  1129. FOX -T
  1130.  
  1131. If you're using FoxPro/Windows or FoxPro/MAC, and want to get rid of
  1132. the "Microsoft FoxPro" title in the bar of the main screen, you can
  1133. do several things.  After your application starts, you can
  1134.  
  1135. MODIFY WINDOW ... TITLE "My Title"
  1136.  
  1137. (Anybody know what the window's called?)
  1138.  
  1139. and the window name will change to whatever your title is.
  1140.  
  1141. You can also put the following line in your config.fpw/config.fpm
  1142. file:
  1143.  
  1144. Title=My Title
  1145.  
  1146. Note the lack of quotes.  This will cause the main window to be listed
  1147. as "My Title" as soon as FoxPro starts up.  For some reason, there are
  1148. differences in the way this works depending on whether you are running
  1149. your application from the development kit or the distribution kit.
  1150.  
  1151. *****
  1152. Outer Joins In FoxPro
  1153.    davec@wsti.demon.co.uk (David Churcher)
  1154.  
  1155. I give up, I RTFM (and I got FAQ'd) and did not find the syntax.
  1156.  
  1157. Using the foxpro Select command, I wish to join two or more tables 
  1158. inclusivley. By this I mean :
  1159.  
  1160.         To join Table A and B, if there is no join then include the
  1161.         records from table A and place blanks in the fields from table B.
  1162.  
  1163. In previous versions of foxpro I would have used "Set relation to" and 
  1164. it would have just happened.
  1165.  
  1166. Oh no, it's the dreaded Left Outer Join! This is an SQL construct which 
  1167. FoxPro doesn't currently support, so you have to simulate it using a 
  1168. UNION of two selects: one for all the records with matches in table B, 
  1169. and one for all the records without. Here's an example:
  1170.  
  1171. SELECT a.keyfield, ;
  1172.        a.datafield1, ;
  1173.        b.datafield2, ;
  1174.        b.datafield3 ;
  1175.    FROM a,b ;
  1176.    WHERE a.keyfield = b.keyfield ;
  1177.    UNION ;
  1178.       SELECT a.keyfield, ;
  1179.              a.datafield1, ;
  1180.              000.00, ;
  1181.              000.00 ;
  1182.          FROM a ;
  1183.          WHERE a.keyfield NOT IN ;
  1184.             (SELECT b.keyfield ;
  1185.                 FROM b)
  1186.  
  1187. Couple of points:
  1188.  
  1189. 1. The numeric and string constants in the second SELECT (000.00 in this
  1190. example) have to exactly match the length of the fields in the second
  1191. database, because FoxPro requires both sides of a UNION to exactly the
  1192. same structure.
  1193.  
  1194. 2. SET RELATION TO and SET SKIP TO may be faster and easier if it's only
  1195. a simple query.
  1196.  
  1197. ****
  1198. Source Code Wanted - Only Singles Need Apply
  1199.    martin@convext.csd.uwm.edu (Martin A. Miller)
  1200.  
  1201. There are two companies who provide software to generate source code
  1202. from compiled Fox* applications/programs.
  1203.  
  1204. 1) Xitech Inc. 
  1205.    Toledo, Ohio (407) 292-8629; FAX: (407) 292-8652
  1206.    Product name: ReFox
  1207.    Restores FoxBASE, FoxBASE+, FoxPro 1.x, FoxPro 2.0,
  1208.    FoxPro 2.5 (including Windows).
  1209.    Cost: $299 + S&H
  1210.  
  1211. 2) HILCO Software
  1212.    Sebastopol, CA (707) 829-5011; FAX: (707) 829-5710
  1213.    Product Names: dCRYPTR for dBASE III Run-Time
  1214.                   DECODE for dBASE II Run-Time
  1215.                   deFOX for FoxBase II (early dBASE II compatible)
  1216.                   OutFOX for Foxbase+
  1217.    Cost: $149.95 + $5.00 S&H
  1218.  
  1219. In addition, Ron Talmadge made me aware of the following:
  1220.    Frx2Prg Version 2.5
  1221.    Have it your way with FoxPro Reports
  1222.    Rory Data International
  1223.    17 Thorburn Road
  1224.    North Potomac, MD 20878
  1225.    Phone: (301) 251-0497
  1226.    BBS: 301-251-9206
  1227.    FAX: 301-258-6862
  1228.    CIS: 73765,121
  1229.  
  1230.    Frx2Prg is a utility that translates a FoxPro 2.0 or 2.5 report
  1231.    format (.FRX) file into a corresponding program (.PRG) file.
  1232.  
  1233. *****
  1234. Unsupported Trick To Get Blank (Not Zero) Fields
  1235.    wsd@world.std.com (Rorschach)
  1236.  
  1237. I been pulling my hair out for hours trying to figure this out.  Is is
  1238. possible to exclude records from an average that are blank?
  1239.  
  1240. DOCUMENT:Q97647  14-DEC-1993  [B_WFOXPRO]
  1241. TITLE   :INF: How Exclude Blanks, but Not Zeros, from an Average
  1242. PRODUCT :FoxPro For Windows
  1243. PROD/VER:2.50 2.50a | 2.00 2.50 2.50a
  1244. OPER/SYS:WINDOWS    | MS-DOS
  1245. KEYWORDS:
  1246.  
  1247. --------------------------------------------------------------------
  1248. The information in this article applies to:
  1249.  
  1250.  - Microsoft FoxPro for Windows, versions 2.5 and 2.5a
  1251.  - Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a
  1252. --------------------------------------------------------------------
  1253.  
  1254. SUMMARY
  1255. =======
  1256.  
  1257. FoxPro's AVERAGE command sums numeric fields and divides the summed result
  1258. by the number of records summed. In some cases, you may want to determine
  1259. the AVERAGE only for fields that are not blank. Since there is no command
  1260. in the FoxPro language that can distinguish between a numeric field that is
  1261. blank and one that contains a zero, you must write a user-defined function
  1262. similar to the one below in order to accomplish this task.
  1263.  
  1264. MORE INFORMATION
  1265. ================
  1266.  
  1267. The following function requires two parameters, the database name and field
  1268. name. An example of calling this function is as follows:
  1269.  
  1270.   ave = ave_nobl("test","num")
  1271.  
  1272. The above command shows "test" as the name of the database file and "num"
  1273. as the numeric field to be averaged.
  1274.  
  1275. Sample Code
  1276. -----------
  1277.  
  1278.    FUNCTION ave_nobl
  1279.  
  1280.    PARAMETERS dbfname,fld_name
  1281.    PRIVATE blank,skipbytes,i,numofblanks
  1282.    skipbytes=0
  1283.    numofblanks=0
  1284.  
  1285.    IF USED(dbfname)
  1286.       SELECT (dbfname)
  1287.    ELSE
  1288.       SELECT 0
  1289.       USE (dbfname)
  1290.    ENDIF
  1291.  
  1292.    headersize = HEADER(dbfname)
  1293.    no_records = RECCOUNT()
  1294.    rec_size   = RECSIZE()
  1295.    fld_width  = FSIZE(fld_name)
  1296.  
  1297.    * Place the database structure information in an array to
  1298.    * determine the field's position. The position is equal to
  1299.    * the row number of the field in the array, which is returned
  1300.    * by ASUBSCRIPT().
  1301.  
  1302.    =afields(afld_pos)
  1303.    fld_pos = ASUBSCRIPT(afld_pos,ASCAN(afld_pos,UPPER(fld_name)),1)
  1304.  
  1305.    FOR i=1 TO (fld_pos-1)
  1306.       skipbytes=skipbytes+FSIZE(FIELD(i))
  1307.    ENDFOR
  1308.    USE
  1309.  
  1310.    blank = REPLICATE(" ",fld_width)
  1311.  
  1312.    m.file = FOPEN(dbfname+".dbf")
  1313.  
  1314.    IF m.file<0
  1315.       RETURN "Error opening database "+dbfname+"."
  1316.    ELSE
  1317.       * The numeric field begins on the first byte following the
  1318.       * header and any preceding fields (headersize+skipbytes+1).
  1319.  
  1320.       m.move = FSEEK(m.file,headersize+skipbytes+1)
  1321.  
  1322.       * Read the value of the numeric field and compare it to
  1323.       * the variable blank.
  1324.  
  1325.       m.num  = FREAD(m.file,fld_width)
  1326.  
  1327.       DO WHILE .NOT. FEOF(m.file)
  1328.          IF m.num = blank
  1329.             numofblanks = numofblanks+1
  1330.          ENDIF
  1331.  
  1332.          * Move to the beginning of the numeric field in the next
  1333.          * record, read the next value, and compare it to the variable
  1334.          * blank.
  1335.  
  1336.          m.move = FSEEK(m.file,(rec_size-fld_width),1)
  1337.          m.num  =   FREAD(m.file,fld_width)
  1338.       ENDDO
  1339.       m.move = FCLOSE(m.file)
  1340.  
  1341.       USE (dbfname)
  1342.       SUM EVAL(fld_name) TO sub_result
  1343.       USE
  1344.  
  1345.       * Divide the sum by the number of records that are not blank.
  1346.  
  1347.       result = sub_result/(no_records-numofblanks)
  1348.  
  1349.       * Return the result to the program that called ave_nobl().
  1350.  
  1351.       RETURN result
  1352.    ENDIF
  1353.  
  1354. Additional reference words: 2.00 2.50 2.50a null blank
  1355.  
  1356. =============================================================================
  1357.  
  1358. THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
  1359. PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MICROSOFT DISCLAIMS
  1360. ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
  1361. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO
  1362. EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
  1363. ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
  1364. CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
  1365. MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
  1366. POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION
  1367. OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
  1368. SO THE FOREGOING LIMITATION MAY NOT APPLY.
  1369.  
  1370. Copyright Microsoft Corporation 1993.
  1371.         
  1372. *****
  1373.    Writable SQL Cursors!
  1374.       By Charlie Lotridge (lotridge@charlie.ccd.bnl.gov)
  1375.  
  1376.    We've all had this problem:  You go to extract some temporary
  1377.    data from a few tables using a SELECT - SQL statement.  You
  1378.    set up the SELECT to output into a cursor so that you have
  1379.    the flexibility and efficiency of a table without having to
  1380.    be concerned about cleaning up after yourself.  THen you decide
  1381.    you'd like to add a record to this cursor or change a value in
  1382.    it and BOOM! - "Cannot Write To A Read-Only File".
  1383.  
  1384.    So what do you do?  In one of their FastTips, Microsot suggests
  1385.    that you first do your SELECT into an array, then create your
  1386.    cursor with the same structure, and finally use the APPEND FROM
  1387.    ARRAY command to move the data into the cursor.  For example:
  1388.  
  1389.    SELECT cust_name ;
  1390.       FROM customers ;
  1391.       INTO ARRAY temp
  1392.    CREATE CURSOR cust_curs ;
  1393.       (cust_name C(30))
  1394.    SELECT cust_curs
  1395.    APPEND FROM ARRAY temp
  1396.    RELEASE temp
  1397.  
  1398.    But this solution is less than ideal for at least two reasons
  1399.    that I can think of.  First, the cost in memory for the array
  1400.    can be quite large if the SELECT - SQL statement generates a
  1401.    lot of data.
  1402.  
  1403.    The second reason is more substantial - you must know the exact
  1404.    structure of the data being generated by the SELECT; both the
  1405.    order of the fields and their respective sizes.  This is at
  1406.    best an inconvenience, since if you change the structure of any
  1407.    of the source DBF's, you may also have to change the program
  1408.    code, and at worst impossible if you're trying to write some
  1409.    generalized routine which doesn't know much about the data
  1410.    it is operating on.
  1411.  
  1412.    [Question from the peanut gallery:  Can't you COPY STRUCTURE TO
  1413.     ARRAY, and then create your cursor from that array?]
  1414.  
  1415.    So what's the solution?  It's simple, really.  I came upon this
  1416.    idea when I was trying to change the alias of a cursor (don't
  1417.    ask why).
  1418.  
  1419.    At the temporary expense of an extra work area, you can rename
  1420.    the alias of your cursor (or any open table for that matter) and
  1421.    at the same time make it writable!!!  For example:
  1422.  
  1423.    PROCEDURE rename_table
  1424.    PARAMETERS m.fromalias, m.toalias
  1425.       * Open the table in another work area. *
  1426.       USE (dbf(m.fromalias)) IN 0 ALIAS (m.toalias) AGAIN
  1427.  
  1428.       * Close the old alias. *
  1429.       USE IN (m.fromalias)
  1430.  
  1431.       * And you're done! *
  1432.    RETURN
  1433.  
  1434.    And that's all there is to it.  The beauty of this solution is that
  1435.    your cursor's new alias has all the appearances of a regular DBF
  1436.    (it shows up in all caps in the View Window, and you can even use
  1437.    the SETUP button on it), yet it retains that most attractive quality
  1438.    of a cursor - it goes away when you close it!
  1439.  
  1440.    If the original alias or workarea of the cursor is important for some
  1441.    reason, with a little extra work rename_table can be make to preserve
  1442.    these characteristics with no loss of functionality.
  1443.  
  1444.    ***WARNING*** In some circumstances, the cursor you create is actually
  1445.    ***WARNING*** just a view of the table, not a seperate table in itself.
  1446.    ***WARNING*** In this case, appending, deleting, or altering records
  1447.    ***WARNING*** in your "cursor" will also alter data in the database.
  1448.  
  1449.  
  1450.  
  1451. [This is FAQ version 1.0.0.2 - Last Updated 10/27/94.  New sections or
  1452. altered text are marked with ">" in the left hand column.  Please send
  1453. all questions, comments, and whatnot to kcochran@nyx.cs.du.edu]
  1454.  
  1455. Before we begin, I'd like to extend my deepest gratitude to Pete
  1456. Kruckenberg (kruckenb@sal.cs.utah.edu) for collecting the information
  1457. found in this FAQ.  If you find any mistakes in this FAQ, please let
  1458. Joseph know about them also.
  1459.  
  1460. ======================================================================
  1461. Foxpro archives
  1462. ---------------
  1463.  Foxpro archives are available by using a File Transfer Protocol
  1464.  program (usually called "ftp"). For help on retrieving files from
  1465.  these sites, see "How to retrieve files from archive sites" below.  
  1466.  Please try to use the FTP site nearest you to conserve bandwidth.
  1467.  
  1468.   SITE:          lenti.med.umn.edu
  1469.   IP ADDRESS:    128.101.81.1
  1470.   DIRECTORY:     /pub/foxpro
  1471.   INDEX:         /pub/foxpro/index
  1472.   ADMIN:         Gerald Skerbitz <gsker@lenti.med.umn.edu>
  1473.  
  1474.   SITE:          nstn.ns.ca
  1475.   IP ADDRESS:    137.186.128.11
  1476.   DIRECTORY:     /pub/pc-stuff/foxpro
  1477.   INDEX:         not available at this time
  1478.   ADMIN:         Paul Russell <russell@atl.sofkin.ca>
  1479.  
  1480.   SITE:          ftp.microsoft.com
  1481.   IP ADDRESS:    198.105.232.1
  1482.   DIRECTORY:     developer/devtools/fox
  1483.                  Changing to developer/fox.
  1484.   INDEX:         index.txt in each subdirectory
  1485.   ADMIN:         <csftpad@microsoft.com>
  1486.  
  1487.   SITE:          mercurio.univr.it (mirrors nstn, lenti, and rahul sites)
  1488.   IP ADDRESS:    157.27.1.2
  1489.   DIRECTORY:     pub/msdos/foxpro
  1490.   INDEX:         pub/msdos/foxpro/00INDEX and pub/msdos/foxpro/index.txt
  1491.   ADMIN:         Germano Rossi <germano@chiostro.univr.it>
  1492.  
  1493. Mailing Lists
  1494. -------------
  1495.  Polar Bear Heaven : (most active of the lists) Send email to 
  1496.    foxpro-help@polarbear.rankin-inlet.nt.ca to receive a help file
  1497.    with instructions on how to subscribe, unsubscribe, and 
  1498.    additional mailing list options.  The subject and message body
  1499.    are not specified for this service--any messages sent to this 
  1500.    address will be replied to with the help file.
  1501.  
  1502.    This mailing list is archived at ftp.rahul.net in pub/coneill.
  1503.  
  1504.    Administrator: Chris O'Neill (coneill@polarbear.rankin-inlet.nt.ca)
  1505.    (Note: replies may take up to 72 hours because of Polarbear's dial-up 
  1506.     connection to the Internet)
  1507.  
  1508.  University of Kansas : send email to LISTSERV@UKANVM.CC.UKANS.EDU 
  1509.    (or LISTSERV@UKANVM.BITNET) with "HELP" as the first word of the 
  1510.    message.  You will receive back a message containing instructions
  1511.    on how to subscribe to or unsubscribe to the mailing list.
  1512.  
  1513.    This list is archived at the List Server.  The help file you will
  1514.    receive explains how to retrieve information from the archive.
  1515.  
  1516.  See "MORE INFORMATION" below for instructions on how to subscribe to
  1517.    each of these mailing lists.
  1518.  
  1519. USENET Newsgroup
  1520. -----------------
  1521.  comp.databases.xbase.fox is an unmoderated USENET newsgroup
  1522.  currently receiving about 150-200 messages per week.  A Frequently
  1523.  Asked Questions list in several parts is posted regularly and is also
  1524.  available from ftp.rahul.net as file foxfaq.zip.  If your Internet
  1525.  provider doesn't have this newsgroup, ask your system administrator
  1526.  to add it to the groups your system receives.
  1527.  
  1528. Newsletter
  1529. ----------
  1530.  The Boston Computer Society publishes a free electronic Foxpro
  1531.  newsletter monthly.  This newsletter is posted to the USENET group
  1532.  comp.databases.xbase.fox and is archived at ftp.rahul.net (filenames
  1533.  bcnn*.zip).  If you would like to receive the newsletter via email,
  1534.  contact Les Squires at 73020.3435@compuserve.com.  Unless email is
  1535.  absolutely necessary (it costs money to mail from Compuserve), try
  1536.  to get the newsletter from these other locations.
  1537.  
  1538. Technical Support
  1539. -----------------
  1540.  Microsoft does not officially support Foxpro on the Internet, though
  1541.  there are MS employees who are on the Polarbear mailing list, and they
  1542.  do have an ftp archive (see above).  The Foxpro Wish List is available
  1543.  by email at foxwish@microsoft.com.
  1544.  
  1545.  
  1546. MORE INFORMATION
  1547. ================
  1548. Subscribing to Foxpro mailing lists
  1549. -----------------------------------
  1550.  To subscribe to the Polar Bear Heaven mailing list, send email to
  1551.  fileserv@polarbear.rankin-inlet.nt.ca with the line
  1552.  
  1553.   JOIN FOXPRO-I Your Full Name (substitute your name here)
  1554.  
  1555.  to join the interactive list (messages sent as they are posted), or
  1556.  
  1557.   JOIN FOXPRO-D Your Full Name
  1558.  
  1559.  to join the digested list (messages are compiled and only sent
  1560.  periodically).
  1561.  
  1562.  To post a message to the Polar Bear Heaven mailing list, send it to
  1563.  
  1564.   FOXPRO-L@polarbear.rankin-inlet.nt.ca
  1565.  
  1566.  To subscribe to the University of Kansas mailing list, send email to
  1567.  LISTSERV@UKANVM.CC.UKANS.EDU (or LISTSERV@UKANVM.BITNET) with the line
  1568.  
  1569.   SUBSCRIBE FOXPRO-L Your Full Name (substitute your name here)
  1570.  
  1571.  To post a message to the University of Kansas mailing list, send it to
  1572.  
  1573.   FOXPRO-L@UKANVM.CC.UKANS.EDU (or FOXPRO-L@UKANVM.BITNET)
  1574.  
  1575.  After subscribing to either of these mailing lists, you will receive
  1576.  a response confirming your subscription to the mailing list and 
  1577.  explaining how to properly use the mailing list. The mailing list will
  1578.  send messages to the email address you sent the subscription request
  1579.  from.
  1580.  
  1581.  Remember not to send mailing list service requests (subscribes, 
  1582.  unsubscribes) to the posting address.  Doing so wastes a lot of time,
  1583.  money, and other resources, and usually upsets a lot of people who
  1584.  don't want to read your "SUBSCRIBE FOXPRO-L John Doe" requests.
  1585.  
  1586. How to retrieve files from archive sites
  1587. ------------------------------------------
  1588.  All of the Foxpro archive sites use the File Transfer Protocol to
  1589.  upload and download files.  The program that you will use to do this
  1590.  is usually called "ftp".  To access an FTP site, start ftp with the
  1591.  name or IP address of the site as a command-line parameter (eg "ftp
  1592.  ftp.rahul.net" or "ftp 192.160.13.1").  
  1593.  
  1594.  Once connected, you will be asked for a login ID.  Use "ftp" or
  1595.  "anonymous" as your login ID, then your full email address (eg
  1596.  "joebob@xyz.com") as your password.  To list a directory, use the "ls"
  1597.  command; to change to a directory, use the "cd" command (eg "cd
  1598.  /pub/coneill").  Before retrieving a file, you should usually turn on
  1599.  the binary transfer mode using the "bin" command.  Then, use the "get"
  1600.  command to retrieve a file (eg "get index.txt").  For help, use the
  1601.  "?" or "help" command.  Finally, to exit ftp, type "quit" or "bye".
  1602. -- 
  1603.  
  1604.  
  1605.